package com.carkeeper.controller;/*
package com.changgou.file.controller;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;

import com.changgou.file.utils.FastDFSClient;
import com.changgou.file.utils.FastDFSFile;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

*/

import com.carkeeper.service.FileService;
import com.carkeeper.utils.FastDFSClient;
import com.carkeeper.utils.FastDFSFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 上传文件操作
 */

@RestController
public class FileController {

    @Autowired
    private FileService fileService;

    /*
     * 文件上传
     *
     */
    @PostMapping("/upload")
    public String upload(@RequestParam MultipartFile file) throws Exception {
      return fileService.upload(file);
    }
}

